use ac_boot;

/*==============================================================*/
/* Table: W_GOODS                                               */
/*==============================================================*/
CREATE TABLE W_GOODS (
                         ID_                  VARCHAR(64)          NOT NULL,
                         REF_ID_              VARCHAR(64)          NULL,
                         PARENT_ID_           VARCHAR(64)          NULL,
                         UPDATE_VERSION_      DECIMAL(14,0)        NULL,
                         SPLB                 VARCHAR(50)          NULL,
                         SPM                  VARCHAR(50)          NULL,
                         KCSL                 DECIMAL(14,0)        NULL,
                         XSDJ                 DECIMAL(14,2)        NULL,
                         CBDJ                 DECIMAL(14,2)        NULL,
                         SPTP                 VARCHAR(200)         NULL,
                         INST_ID_             VARCHAR(64)          NULL,
                         INST_STATUS_         VARCHAR(64)          NULL,
                         TENANT_ID_           VARCHAR(64)          NULL,
                         CREATE_TIME_         DATETIME            NULL,
                         CREATE_BY_           VARCHAR(64)          NULL,
                         UPDATE_BY_           VARCHAR(64)          NULL,
                         UPDATE_TIME_         DATETIME            NULL,
                         CREATE_DEP_ID_       VARCHAR(64)          NULL,
                         COMPANY_ID_          VARCHAR(24)          NULL,
                         CREATE_BY_NAME       VARCHAR(64)          NULL,
                         UPDATE_BY_NAME       VARCHAR(64)          NULL,
                         SPLB_NAME            VARCHAR(50)          NULL,
                         CONSTRAINT PK_W_GOODS PRIMARY KEY NONCLUSTERED (ID_)
)
    go

IF EXISTS (SELECT 1 FROM  SYS.EXTENDED_PROPERTIES
           WHERE MAJOR_ID = OBJECT_ID('W_GOODS') AND MINOR_ID = 0)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '商品表',
   'user', @CURRENTUSER, 'table', 'W_GOODS'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '主键',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'REF_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'REF_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '外键',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'REF_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'PARENT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'PARENT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '父ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'PARENT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_VERSION_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_VERSION_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '版本号',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_VERSION_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SPLB')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPLB'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '商品类别',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPLB'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SPM')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPM'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '商品名',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPM'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'KCSL')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'KCSL'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '库存数量',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'KCSL'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSDJ')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'XSDJ'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售单价',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'XSDJ'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CBDJ')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CBDJ'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '成本单价',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CBDJ'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SPTP')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPTP'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '商品图片',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPTP'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'INST_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '流程实例ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'INST_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_STATUS_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'INST_STATUS_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '状态',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'INST_STATUS_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'TENANT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'TENANT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '租户ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'TENANT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建时间',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新时间',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_DEP_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_DEP_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '组ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_DEP_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'COMPANY_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'COMPANY_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '公司ID',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'COMPANY_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人名称',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'CREATE_BY_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人名称',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'UPDATE_BY_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_GOODS')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SPLB_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPLB_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '商品类别名称',
   'user', @CURRENTUSER, 'table', 'W_GOODS', 'column', 'SPLB_NAME'
go

/*==============================================================*/
/* Table: W_ORDER                                               */
/*==============================================================*/
CREATE TABLE W_ORDER (
                         ID_                  VARCHAR(64)          NOT NULL,
                         REF_ID_              VARCHAR(64)          NULL,
                         PARENT_ID_           VARCHAR(64)          NULL,
                         UPDATE_VERSION_      DECIMAL(14,0)        NULL DEFAULT 0,
                         DDH                  VARCHAR(50)          NULL,
                         RQ                   DATETIME            NULL,
                         SZSS_PROVINCE        VARCHAR(50)          NULL,
                         SZSS_P_CODE          VARCHAR(50)          NULL,
                         SZSS_CITY            VARCHAR(50)          NULL,
                         SZSS_CITY_CODE       VARCHAR(50)          NULL,
                         XZKH                 VARCHAR(200)         NULL,
                         XZKH_NAME            VARCHAR(200)         NULL,
                         KHLB                 VARCHAR(50)          NULL,
                         KHXM                 VARCHAR(50)          NULL,
                         XSY                  VARCHAR(500)         NULL,
                         XSY_NAME             VARCHAR(500)         NULL,
                         LR                   DECIMAL(14,2)        NULL,
                         CB                   DECIMAL(14,2)        NULL,
                         XSE                  DECIMAL(14,2)        NULL,
                         LRL                  DECIMAL(14,2)        NULL,
                         NF                   VARCHAR(50)          NULL,
                         YF                   VARCHAR(50)          NULL,
                         INST_ID_             VARCHAR(64)          NULL,
                         INST_STATUS_         VARCHAR(64)          NULL,
                         TENANT_ID_           VARCHAR(64)          NULL,
                         CREATE_TIME_         DATETIME            NULL,
                         CREATE_BY_           VARCHAR(64)          NULL,
                         UPDATE_BY_           VARCHAR(64)          NULL,
                         UPDATE_TIME_         DATETIME            NULL,
                         CREATE_DEP_ID_       VARCHAR(64)          NULL,
                         COMPANY_ID_          VARCHAR(24)          NULL,
                         CREATE_BY_NAME       VARCHAR(64)          NULL,
                         UPDATE_BY_NAME       VARCHAR(64)          NULL,
                         CONSTRAINT PK_W_ORDER PRIMARY KEY NONCLUSTERED (ID_)
)
    go

IF EXISTS (SELECT 1 FROM  SYS.EXTENDED_PROPERTIES
           WHERE MAJOR_ID = OBJECT_ID('W_ORDER') AND MINOR_ID = 0)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '订单表',
   'user', @CURRENTUSER, 'table', 'W_ORDER'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '主键',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'REF_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'REF_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '外键',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'REF_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'PARENT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'PARENT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '父ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'PARENT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_VERSION_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_VERSION_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '版本号',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_VERSION_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'DDH')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'DDH'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '订单号',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'DDH'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'RQ')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'RQ'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '日期',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'RQ'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SZSS_PROVINCE')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_PROVINCE'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '省',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_PROVINCE'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SZSS_P_CODE')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_P_CODE'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '省Code',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_P_CODE'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SZSS_CITY')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_CITY'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '市',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_CITY'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SZSS_CITY_CODE')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_CITY_CODE'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '市Code',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'SZSS_CITY_CODE'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XZKH')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XZKH'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '选择客户ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XZKH'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XZKH_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XZKH_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '选择客户',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XZKH_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'KHLB')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'KHLB'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '客户类别',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'KHLB'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'KHXM')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'KHXM'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '客户姓名',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'KHXM'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSY')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSY'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售员ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSY'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售员',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSY_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'LR')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'LR'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '利润',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'LR'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CB')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CB'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '成本 ',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CB'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSE')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSE'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售额',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'XSE'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'LRL')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'LRL'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '利润率',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'LRL'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'NF')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'NF'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '年份',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'NF'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'YF')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'YF'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '月份',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'YF'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'INST_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '流程实例ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'INST_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_STATUS_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'INST_STATUS_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '状态',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'INST_STATUS_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'TENANT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'TENANT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '租户ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'TENANT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建时间',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新时间',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_DEP_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_DEP_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '组ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_DEP_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'COMPANY_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'COMPANY_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '公司ID',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'COMPANY_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人名称',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'CREATE_BY_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_ORDER')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人名称',
   'user', @CURRENTUSER, 'table', 'W_ORDER', 'column', 'UPDATE_BY_NAME'
go

/*==============================================================*/
/* Table: W_SALEDETAIL                                          */
/*==============================================================*/
CREATE TABLE W_SALEDETAIL (
                              ID_                  VARCHAR(64)          NOT NULL,
                              REF_ID_              VARCHAR(64)          NULL,
                              PARENT_ID_           VARCHAR(64)          NULL,
                              UPDATE_VERSION_      DECIMAL(14,0)        NULL,
                              DDH                  VARCHAR(50)          NULL,
                              CPLB                 VARCHAR(50)          NULL,
                              CPM                  VARCHAR(50)          NULL,
                              SL                   DECIMAL(14,0)        NULL,
                              XSJG                 DECIMAL(14,0)        NULL,
                              CBJG                 DECIMAL(14,0)        NULL,
                              CB                   DECIMAL(14,0)        NULL,
                              XSE                  DECIMAL(14,0)        NULL,
                              INST_ID_             VARCHAR(64)          NULL,
                              INST_STATUS_         VARCHAR(64)          NULL,
                              TENANT_ID_           VARCHAR(64)          NULL,
                              CREATE_TIME_         DATETIME            NULL,
                              CREATE_BY_           VARCHAR(64)          NULL,
                              UPDATE_BY_           VARCHAR(64)          NULL,
                              UPDATE_TIME_         DATETIME            NULL,
                              CREATE_DEP_ID_       VARCHAR(64)          NULL,
                              COMPANY_ID_          VARCHAR(24)          NULL,
                              CREATE_BY_NAME       VARCHAR(64)          NULL,
                              UPDATE_BY_NAME       VARCHAR(64)          NULL,
                              CONSTRAINT PK_W_SALEDETAIL PRIMARY KEY NONCLUSTERED (ID_)
)
    go

IF EXISTS (SELECT 1 FROM  SYS.EXTENDED_PROPERTIES
           WHERE MAJOR_ID = OBJECT_ID('W_SALEDETAIL') AND MINOR_ID = 0)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售明细',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '主键',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'REF_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'REF_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '外键',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'REF_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'PARENT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'PARENT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '父ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'PARENT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_VERSION_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_VERSION_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '版本号',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_VERSION_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'DDH')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'DDH'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '订单号',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'DDH'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CPLB')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CPLB'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '产品类别',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CPLB'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CPM')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CPM'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '产品名',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CPM'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'SL')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'SL'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '数量',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'SL'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSJG')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'XSJG'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售价格',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'XSJG'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CBJG')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CBJG'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '成本价格',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CBJG'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CB')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CB'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '成本',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CB'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'XSE')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'XSE'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '销售额',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'XSE'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'INST_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '流程实例ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'INST_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'INST_STATUS_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'INST_STATUS_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '状态',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'INST_STATUS_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'TENANT_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'TENANT_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '租户ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'TENANT_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建时间',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_BY_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_BY_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_TIME_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_TIME_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新时间',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_TIME_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_DEP_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_DEP_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '组ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_DEP_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'COMPANY_ID_')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'COMPANY_ID_'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '公司ID',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'COMPANY_ID_'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'CREATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '创建人名称',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'CREATE_BY_NAME'
go

IF EXISTS(SELECT 1 FROM SYS.EXTENDED_PROPERTIES P WHERE
      P.MAJOR_ID = OBJECT_ID('W_SALEDETAIL')
  AND P.MINOR_ID = (SELECT C.COLUMN_ID FROM SYS.COLUMNS C WHERE C.OBJECT_ID = P.MAJOR_ID AND C.NAME = 'UPDATE_BY_NAME')
)
BEGIN
   DECLARE @CURRENTUSER SYSNAME
SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_DROPEXTENDEDPROPERTY 'MS_Description',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_BY_NAME'

END


SELECT @CURRENTUSER = USER_NAME()
    EXECUTE SP_ADDEXTENDEDPROPERTY 'MS_Description',
   '更新人名称',
   'user', @CURRENTUSER, 'table', 'W_SALEDETAIL', 'column', 'UPDATE_BY_NAME'
go


INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '13',            '0',          '1',          'admin-管理员',          null,          '2023-5-25 14:56:09',          '1661627192632676353',          null,          null,          '500',          '0',          null,          'fresh',          '生鲜',          '榴莲',          '[]',          '1',          null,          null,          null,          '1',          '30');

INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '20',            '0',          '1',          'admin-管理员',          null,          '2023-5-25 14:56:43',          '1661627334177853442',          null,          null,          '1000',          '0',          null,          'fresh',          '生鲜',          '草莓',          '[]',          '1',          null,          null,          null,          '1',          '40');

INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '3',            '0',          '1',          'admin-管理员',          null,          '2023-5-25 14:57:12',          '1661627458836762625',          null,          null,          '1000',          '0',          null,          'fresh',          '生鲜',          '苹果',          '[]',          '1',          null,          null,          null,          '1',          '7');

INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '6',            '0',          '1',          'admin-管理员',          null,          '2023-5-25 14:58:44',          '1661627841839632385',          null,          null,          '100',          '0',          null,          'fresh',          '生鲜',          '蓝莓',          '[]',          '1',          '1',          'admin-管理员',          '2023-5-26 9:07:38',          '1',          '12');

INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '1',            '0',          '1',          'admin-管理员',          null,          '2023-5-25 14:59:24',          '1661628009997668354',          null,          null,          '5000',          '0',          null,          'fresh',          '生鲜',          '西瓜',          '[]',          '1',          null,          null,          null,          '1',          '3');

INSERT INTO w_goods(CBDJ,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,ID_,INST_ID_,INST_STATUS_,KCSL,PARENT_ID_,REF_ID_,SPLB,SPLB_NAME,SPM,SPTP,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSDJ)
values(          '5',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 9:09:11',          '1661902265323098114',          null,          null,          '300',          '0',          null,          'fresh',          '生鲜',          '哈密瓜',          '[]',          '1',          null,          null,          null,          '1',          '10');

INSERT INTO w_order(CB,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,KHLB,KHXM,LR,LRL,NF,PARENT_ID_,REF_ID_,RQ,SZSS_CITY,SZSS_CITY_CODE,SZSS_P_CODE,SZSS_PROVINCE,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSY,XSY_NAME,XZKH,XZKH_NAME,YF)
values(          '20080',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 9:07:12',          '2023052600001',          '1661901763877277698',          null,          null,          'VIP客户',          '张三丰',          '20780',          '1',          '2023年',          '0',          null,          '2023-5-26 0:00:00',          '广州市',          '440100000000',          '440000000000',          '广东省',          '1',          '1',          'admin-管理员',          '2023-5-26 11:50:01',          '1',          '40860',          '1545248508175101954',          '张飞',          '',          '',          '05月');

INSERT INTO w_order(CB,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,KHLB,KHXM,LR,LRL,NF,PARENT_ID_,REF_ID_,RQ,SZSS_CITY,SZSS_CITY_CODE,SZSS_P_CODE,SZSS_PROVINCE,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSY,XSY_NAME,XZKH,XZKH_NAME,YF)
values(          '9348',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 11:32:32',          '2023052600004',          '1661938340577939458',          null,          null,          'VIP客户',          '张三丰',          '10519',          '1',          '2022年',          '0',          null,          '2022-5-25 0:00:00',          '广州市',          '440100000000',          '440000000000',          '广东省',          '1',          '1',          'admin-管理员',          '2023-5-26 11:46:56',          '1',          '19867',          '1651877796986753025',          'test',          '',          '',          '05月');

INSERT INTO w_order(CB,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,KHLB,KHXM,LR,LRL,NF,PARENT_ID_,REF_ID_,RQ,SZSS_CITY,SZSS_CITY_CODE,SZSS_P_CODE,SZSS_PROVINCE,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSY,XSY_NAME,XZKH,XZKH_NAME,YF)
values(          '49320',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691358838785',          null,          null,          'VIP客户',          '张三丰',          '55456',          '1',          '2021年',          '0',          null,          '2021-5-26 0:00:00',          '广州市',          '440100000000',          '440000000000',          '广东省',          '1',          null,          null,          null,          '1',          '104776',          '1545248508175101954',          '张飞',          '',          '',          '05月');

INSERT INTO w_order(CB,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,KHLB,KHXM,LR,LRL,NF,PARENT_ID_,REF_ID_,RQ,SZSS_CITY,SZSS_CITY_CODE,SZSS_P_CODE,SZSS_PROVINCE,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSY,XSY_NAME,XZKH,XZKH_NAME,YF)
values(          '40710',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310303891458',          null,          null,          'VIP客户',          '张三丰',          '46866',          '1',          '2020年',          '0',          null,          '2020-5-26 0:00:00',          '广州市',          '440100000000',          '440000000000',          '广东省',          '1',          null,          null,          null,          '1',          '87576',          '1651877796986753025',          'test',          '',          '',          '05月');

INSERT INTO w_order(CB,COMPANY_ID_,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,KHLB,KHXM,LR,LRL,NF,PARENT_ID_,REF_ID_,RQ,SZSS_CITY,SZSS_CITY_CODE,SZSS_P_CODE,SZSS_PROVINCE,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSY,XSY_NAME,XZKH,XZKH_NAME,YF)
values(          '58920',            '0',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068680192001',          null,          null,          'VIP客户',          '张三丰',          '74932',          '1',          '2019年',          '0',          null,          '2019-5-26 0:00:00',          '广州市',          '440100000000',          '440000000000',          '广东省',          '1',          null,          null,          null,          '1',          '133852',          '1545248508175101954',          '张飞',          '',          '',          '05月');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '3600',          '12',            '0',          'fresh',          '榴莲',          '1',          'admin-管理员',          null,          '2023-5-26 9:07:12',          '2023052600001',          '1661901764934242305',          null,          null,          '0',          '1661901763877277698',          '300',          '1',          '1',          'admin-管理员',          '2023-5-26 11:50:01',          '5',          '8700',          '29');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '16000',          '20',            '0',          'fresh',          '草莓',          '1',          'admin-管理员',          null,          '2023-5-26 9:07:12',          '2023052600001',          '1661901765240426497',          null,          null,          '0',          '1661901763877277698',          '800',          '1',          '1',          'admin-管理员',          '2023-5-26 11:50:01',          '5',          '31200',          '39');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '480',          '3',            '0',          'fresh',          '苹果',          '1',          'admin-管理员',          null,          '2023-5-26 9:07:12',          '2023052600001',          '1661901765408198658',          null,          null,          '0',          '1661901763877277698',          '160',          '1',          '1',          'admin-管理员',          '2023-5-26 11:50:01',          '5',          '960',          '6');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '0',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 9:08:23',          '2023052600001',          '1661902060716560386',          null,          null,          '0',          '1661902060716560386',          '0',          '1',          null,          null,          null,          '1',          '0',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '0',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 9:08:23',          '2023052600001',          '1661902060775280642',          null,          null,          '0',          '1661902060775280642',          '0',          '1',          null,          null,          null,          '1',          '0',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '0',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 9:10:31',          '2023052600001',          '1661902599055478786',          null,          null,          '0',          '1661902599055478786',          '0',          '1',          null,          null,          null,          '1',          '0',          '9');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '0',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 9:10:31',          '2023052600001',          '1661902599118393345',          null,          null,          '0',          '1661902599118393345',          '0',          '1',          null,          null,          null,          '1',          '0',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '0',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 9:10:31',          '2023052600001',          '1661902599172919297',          null,          null,          '0',          '1661902599172919297',          '0',          '1',          null,          null,          null,          '1',          '0',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1500',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:32:32',          '2023052600004',          '1661938340682797058',          null,          null,          '0',          '1661938340577939458',          '300',          '1',          '1',          'admin-管理员',          '2023-5-26 11:46:56',          '3',          '2700',          '9');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1920',          '12',            '0',          'fresh',          '榴莲',          '1',          'admin-管理员',          null,          '2023-5-26 11:32:32',          '2023052600004',          '1661938340749905921',          null,          null,          '0',          '1661938340577939458',          '160',          '1',          '1',          'admin-管理员',          '2023-5-26 11:46:56',          '3',          '4640',          '29');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '3000',          '3',            '0',          'fresh',          '苹果',          '1',          'admin-管理员',          null,          '2023-5-26 11:32:32',          '2023052600004',          '1661938340837986305',          null,          null,          '0',          '1661938340577939458',          '1000',          '1',          '1',          'admin-管理员',          '2023-5-26 11:46:56',          '3',          '6000',          '6');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '2000',          '20',            '0',          'fresh',          '草莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:46:56',          '2023052600004',          '1661941962246197250',          null,          null,          '0',          '1661941962246197250',          '100',          '1',          null,          null,          null,          '1',          '3990',          '39');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '400',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:46:56',          '2023052600004',          '1661941962296528897',          null,          null,          '0',          '1661941962296528897',          '500',          '1',          null,          null,          null,          '1',          '1490',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '528',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:46:56',          '2023052600004',          '1661941962334277633',          null,          null,          '0',          '1661941962334277633',          '88',          '1',          null,          null,          null,          '1',          '1047',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '528',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:47:52',          '2023052600001',          '1661942197374685185',          null,          null,          '0',          '1661942197374685185',          '88',          '1',          null,          null,          null,          '1',          '1047',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '800',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:47:52',          '2023052600001',          '1661942197475348481',          null,          null,          '0',          '1661942197475348481',          '1000',          '1',          null,          null,          null,          '1',          '2980',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1600',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:47:52',          '2023052600001',          '1661942197785726977',          null,          null,          '0',          '1661942197785726977',          '320',          '1',          null,          null,          null,          '1',          '3136',          '9');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '10320',          '12',            '0',          'fresh',          '榴莲',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691438530561',          null,          null,          '0',          '1661942691358838785',          '800',          '1',          null,          null,          null,          '1',          '23920',          '29');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '32000',          '20',            '0',          'fresh',          '草莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691501445121',          null,          null,          '0',          '1661942691358838785',          '1600',          '1',          null,          null,          null,          '1',          '63840',          '39');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1200',          '3',            '0',          'fresh',          '苹果',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691543388162',          null,          null,          '0',          '1661942691358838785',          '400',          '1',          null,          null,          null,          '1',          '2796',          '6');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1200',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691585331201',          null,          null,          '0',          '1661942691358838785',          '200',          '1',          null,          null,          null,          '1',          '2380',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1600',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691623079937',          null,          null,          '0',          '1661942691358838785',          '2000',          '1',          null,          null,          null,          '1',          '5960',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '3000',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:49:50',          '2023052600005',          '1661942691652440066',          null,          null,          '0',          '1661942691358838785',          '600',          '1',          null,          null,          null,          '1',          '5880',          '9');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '6450',          '12',            '0',          'fresh',          '榴莲',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310576521218',          null,          null,          '0',          '1661943310303891458',          '500',          '1',          null,          null,          null,          '1',          '14950',          '29');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '24000',          '20',            '0',          'fresh',          '草莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310647824385',          null,          null,          '0',          '1661943310303891458',          '1200',          '1',          null,          null,          null,          '1',          '47880',          '39');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '4800',          '3',            '0',          'fresh',          '苹果',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310811402242',          null,          null,          '0',          '1661943310303891458',          '1600',          '1',          null,          null,          null,          '1',          '11184',          '6');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1560',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310853345281',          null,          null,          '0',          '1661943310303891458',          '260',          '1',          null,          null,          null,          '1',          '3094',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1600',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310891094017',          null,          null,          '0',          '1661943310303891458',          '2000',          '1',          null,          null,          null,          '1',          '5960',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '2300',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:52:17',          '2023052600006',          '1661943310920454146',          null,          null,          '0',          '1661943310303891458',          '460',          '1',          null,          null,          null,          '1',          '4508',          '9');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '36120',          '12',            '0',          'fresh',          '榴莲',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068734717953',          null,          null,          '0',          '1661944068680192001',          '2800',          '1',          null,          null,          null,          '1',          '83720',          '29');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '12000',          '20',            '0',          'fresh',          '草莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068789243906',          null,          null,          '0',          '1661944068680192001',          '600',          '1',          null,          null,          null,          '1',          '23940',          '39');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '4320',          '3',            '0',          'fresh',          '苹果',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068835381250',          null,          null,          '0',          '1661944068680192001',          '1440',          '1',          null,          null,          null,          '1',          '10065',          '6');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1560',          '6',            '0',          'fresh',          '蓝莓',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068885712897',          null,          null,          '0',          '1661944068680192001',          '260',          '1',          null,          null,          null,          '1',          '3094',          '11');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '1920',          '0',            '0',          'fresh',          '西瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068919267329',          null,          null,          '0',          '1661944068680192001',          '2400',          '1',          null,          null,          null,          '1',          '7152',          '2');

INSERT INTO w_saledetail(CB,CBJG,COMPANY_ID_,CPLB,CPM,CREATE_BY_,CREATE_BY_NAME,CREATE_DEP_ID_,CREATE_TIME_,DDH,ID_,INST_ID_,INST_STATUS_,PARENT_ID_,REF_ID_,SL,TENANT_ID_,UPDATE_BY_,UPDATE_BY_NAME,UPDATE_TIME_,UPDATE_VERSION_,XSE,XSJG)
values(          '3000',          '5',            '0',          'fresh',          '哈密瓜',          '1',          'admin-管理员',          null,          '2023-5-26 11:55:18',          '2023052600007',          '1661944068969598977',          null,          null,          '0',          '1661944068680192001',          '600',          '1',          null,          null,          null,          '1',          '5880',          '9');

